
# from fake_useragent import UserAgent

# ua = UserAgent()

# print(ua.ie)
# print(ua.random)
# print(ua.random)
# print(ua.random)

# url = 'http://www.baidu.com/res/book/'


# print(url.split('/')[-2])

'''
d = {'subjects': [{'rate': '8.1', 'cover_x': 1383, 'title': '克里斯托弗·罗宾', 'url': 'https://movie.douban.com/subject/26359235/', 'playable': False, 'cover': 'https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2523016274.jpg', 'id': '26359235', 'cover_y': 2048, 'is_new': False}, {'rate': '8.7', 'cover_x': 640, 'title': '幸福的拉扎罗', 'url': 'https://movie.douban.com/subject/27072795/', 'playable': False, 'cover': 'https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2521583093.jpg', 'id': '27072795', 'cover_y': 914, 'is_new': False}, {'rate': '8.3', 'cover_x': 690, 'title': '特工', 'url': 'https://movie.douban.com/subject/26683421/', 'playable': False, 'cover': 'https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2528281606.jpg', 'id': '26683421', 'cover_y': 986, 'is_new': False}, {'rate': '6.9', 'cover_x': 675, 'title': '伸冤人2', 'url': 'https://movie.douban.com/subject/26356631/', 'playable': False, 'cover': 'https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2529742142.jpg', 'id': '26356631', 'cover_y': 1000, 'is_new': False}, {'rate': '6.5', 'cover_x': 1000, 'title': '阿尔法：狼伴归途', 'url': 'https://movie.douban.com/subject/26810318/', 'playable': False, 'cover': 'https://img1.doubanio.com/view/photo/s_ratio_poster/public/p2530871439.jpg', 'id': '26810318', 'cover_y': 1400, 'is_new': False}, {'rate': '6.2', 'cover_x': 2500, 'title': '狄仁杰之四大天王', 'url': 'https://movie.douban.com/subject/25882296/', 'playable': True, 'cover': 'https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2526405034.jpg', 'id': '25882296', 'cover_y': 3500, 'is_new': False}, {'rate': '6.8', 'cover_x': 1000, 'title': '协商', 'url': 'https://movie.douban.com/subject/27040853/', 'playable': False, 'cover': 'https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2530394864.jpg', 'id': '27040853', 'cover_y': 1429, 'is_new': False}, {'rate': '7.9', 'cover_x': 2570, 'title': '冷战', 'url': 'https://movie.douban.com/subject/26894602/', 'playable': False, 'cover': 'https://img1.doubanio.com/view/photo/s_ratio_poster/public/p2526989708.jpg', 'id': '26894602', 'cover_y': 3704, 'is_new': False}, {'rate': '6.8', 'cover_x': 2073, 'title': '22英里', 'url': 'https://movie.douban.com/subject/26437223/', 'playable': False, 'cover': 'https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2520254064.jpg', 'id': '26437223', 'cover_y': 3072, 'is_new': False}, {'rate': '7.9', 'cover_x': 1300, 'title': '燃烧', 'url': 'https://movie.douban.com/subject/26842702/', 'playable': False, 'cover': 'https://img1.doubanio.com/view/photo/s_ratio_poster/public/p2520095279.jpg', 'id': '26842702', 'cover_y': 1856, 'is_new': False}, {'rate': '5.8', 'cover_x': 2514, 'title': '名侦探柯南：零的执行人', 'url': 'https://movie.douban.com/subject/27110363/', 'playable': False, 'cover': 'https://img1.doubanio.com/view/photo/s_ratio_poster/public/p2537037239.jpg', 'id': '27110363', 'cover_y': 3462, 'is_new': False}, {'rate': '7.5', 'cover_x': 800, 'title': '与神同行2：因与缘', 'url': 'https://movie.douban.com/subject/27003543/', 'playable': False, 'cover': 'https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2527205786.jpg', 'id': '27003543', 'cover_y': 1146, 'is_new': False}, {'rate': '6.9', 'cover_x': 1079, 'title': '风语咒', 'url': 'https://movie.douban.com/subject/30146756/', 'playable': True, 'cover': 'https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2530872223.jpg', 'id': '30146756', 'cover_y': 1685, 'is_new': False}, {'rate': '8.1', 'cover_x': 1968, 'title': '复仇者联盟3：无限战争', 'url': 'https://movie.douban.com/subject/24773958/', 'playable': True, 'cover': 'https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2517753454.jpg', 'id': '24773958', 'cover_y': 2756, 'is_new': False}, {'rate': '7.7', 'cover_x': 960, 'title': '与神同行：罪与罚', 'url': 'https://movie.douban.com/subject/11584016/', 'playable': False, 'cover': 'https://img1.doubanio.com/view/photo/s_ratio_poster/public/p2500130777.jpg', 'id': '11584016', 'cover_y': 1372, 'is_new': False}, {'rate': '6.7', 'cover_x': 2764, 'title': '瞒天过海：美人计', 'url': 'https://movie.douban.com/subject/26654269/', 'playable': False, 'cover': 'https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2508259902.jpg', 'id': '26654269', 'cover_y': 4096, 'is_new': False}, {'rate': '8.1', 'cover_x': 1280, 'title': '大象席地而坐', 'url': 'https://movie.douban.com/subject/27172891/', 'playable': False, 'cover': 'https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2511811355.jpg', 'id': '27172891', 'cover_y': 1791, 'is_new': False}, {'rate': '8.3', 'cover_x': 2121, 'title': '沉默的教室', 'url': 'https://movie.douban.com/subject/27608785/', 'playable': False, 'cover': 'https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2535799024.jpg', 'id': '27608785', 'cover_y': 3000, 'is_new': False}, {'rate': '7.1', 'cover_x': 2024, 'title': '遗传厄运', 'url': 'https://movie.douban.com/subject/27621727/', 'playable': False, 'cover': 'https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2518865763.jpg', 'id': '27621727', 'cover_y': 3000, 'is_new': False}, {'rate': '7.8', 'cover_x': 2332, 'title': '喜欢，轻吻，快跑', 'url': 'https://movie.douban.com/subject/26979199/', 'playable': False,'cover': 'https://img1.doubanio.com/view/photo/s_ratio_poster/public/p2527725378.jpg', 'id': '26979199', 'cover_y': 3328, 'is_new': False}]}

print (type(d))
aa = d['subjects']
for key in aa:
    print (key['title'])
'''
from types import MethodType




class Student(object):
    # __slots__= ('name', 'age', 'set_age')
    def __init__(self, name):
        self.name = name
        self.age = 22

    def __str__(self):
        return 'Studuent name:%s ,age: %s' % (self.name , self.age)

     

s = Student('wbz')

'''
It gives us a sense of determination, a feeling that it will be done
Eliminate the word try from you dictionary
disempower
Even the smallest word have the deepest effect on our subconscious mind
inpect 
in order to dramatically improve our quality of life  
entirely up to you 
damages our self-easteem
limit out infinite ability
stifles creativity
internal rub
stifles activity
infinite ability
disempower us

'''
 
def fbnq(max):
    a,b,n = 0,1,0
    while n<max:
        yield b
        a, b = b, a+b
        n += 1


# G = fbnq(8)  

# for i in G:
#     print(i)

L = []
def fba(max):
    n, a, b = 0, 0, 1
    while n < max:
        yield b
        a, b = b, a+b
        n = n+1


f = fba(8)
print(f.__next__())  
print(f.__next__())
print(f.__next__())
print(f.__next__())

